package com.dxf.bigdata.D01_test;

//import javafx.concurrent.Task;
import org.apache.commons.math3.fitting.leastsquares.EvaluationRmsChecker;
import scala.collection.$colon$plus$;

import java.util.*;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Student2 {
    public Object name;
    public Object age;
    static List list;

    static {
        list = new ArrayList<String>();
    }

    @Override
    public boolean equals(Object o) {

//        new HashMap<>()

        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student2 student2 = (Student2) o;
        return name.equals(student2.name) &&
                age.equals(student2.age);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age);
    }


    public static void main(String[] args) throws InterruptedException {
       /* ExecutorService pool = Executors.newFixedThreadPool(5);

        pool.execute(() -> {
            synchronized (list) {

                while (true) {
                    try {
                        Thread.sleep(5000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println(list);
                }

            }
        });*/

        A a = new A();
        a.setName("A name");
        B b = new B();
        b.setName("B name");

        System.out.println(a.getName());
        System.out.println(b.getName());


    }
}

class A {
    protected static String name ;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}


class B extends  A{
    @Override
    public void setName(String name) {
        super.setName(name);
    }
}
